package com.netease.nie.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.netease.nie.model.Orders;

public interface OrdersMapper {

	Long insertOrder(@Param(value = "orders") Orders orders);

	List<Orders> listLastThreeMonthsOrderByUserId(@Param("userId") long userId,
			@Param("pageIndex") int pageIndex, @Param("pageSize") int pageSize,
			@Param("currentTime") long currentTime,
			@Param("threeMonthAgo") long threeMonthAgo);

	int getExchangeCountByUserId(@Param("userId") long userId);

	Orders getOrderByUserIdGoodsId(@Param("userId") long userId,
			@Param("goodsId") int goodsId,
			@Param("exchangeCodeId") int exchangeCodeId);

	Orders getOrderByOrderIdAndUserId(@Param("orderId") long orderId,
			@Param("userId") long userId);

	List<Orders> queryRobGoodsOrdersByUserId(@Param("userId") long userId,
			@Param("pageIndex") int pageIndex, @Param("pageSize") int pageSize);

	List<Orders> queryDrawLotteryNormalGoodsOrdersByUserId(
			@Param("userId") long userId, @Param("pageIndex") int pageIndex,
			@Param("pageSize") int pageSize);
}
